const categoryList = [
  {
    name: '酒店', imageSource: '../../images/hotel.png', flag: "hotel"
  },
  {
    name: '美食', imageSource: '../../images/food.png', flag: "food"
  },
  {
    name: '服务', imageSource: '../../images/service.png', flag: "server"
  },
  {
    name: '电影', imageSource: '../../images/cidian.png', flag: "move"
  },
  {
    name: '娱乐', imageSource: '../../images/yule.png', flag: "yule"
  },
  {
    name: '服饰', imageSource: '../../images/tiyu.png', flag: "fushi"
  },
  {
    name: '教育', imageSource: '../../images/report.png', flag: "jiaoyu"
  },
  {
    name: '综合', imageSource: '../../images/more.png', flag: "zonghe"
  }
]

const nearList = [{
  pageName: "1", selected: true,itemlist:[
  {
    name: '服务', imageSource: '../../images/hotel.png', flag: "hotel"
  },
  {
    name: '招聘', imageSource: '../../images/food.png', flag: "food"
  },
  {
    name: '吃饭', imageSource: '../../images/service.png', flag: "server"
  },
  {
    name: '电影', imageSource: '../../images/cidian.png', flag: "move"
  },
  {
    name: '娱乐', imageSource: '../../images/yule.png', flag: "yule"
  },
  {
    name: '家政', imageSource: '../../images/tiyu.png', flag: "fushi"
  },
  {
    name: '家教', imageSource: '../../images/report.png', flag: "jiaoyu"
  },
  {
    name: '兼职', imageSource: '../../images/more.png', flag: "zonghe"
  }
  ]},
  {
    pageName: "2", selected: false, itemlist:[
  {
    name: '宠物', imageSource: '../../images/more.png', flag: "zonghe"
  },
  {
    name: '房产', imageSource: '../../images/more.png', flag: "zonghe"
  }
  ,
  {
    name: '商务', imageSource: '../../images/more.png', flag: "zonghe"
  }
  ,
  {
    name: '家私', imageSource: '../../images/more.png', flag: "zonghe"
  }
  ,
  {
    name: '汽车', imageSource: '../../images/more.png', flag: "zonghe"
  }
  ,
  {
    name: '二手', imageSource: '../../images/more.png', flag: "zonghe"
  }
  ,
  {
    name: '旅游', imageSource: '../../images/more.png', flag: "zonghe"
  } ,
  {
    name: '综合', imageSource: '../../images/more.png', flag: "zonghe"
  }
  ]}
]


const formatTime = date => {
  const year = date.getFullYear()
  const month = date.getMonth() + 1
  const day = date.getDate()
  const hour = date.getHours()
  const minute = date.getMinutes()
  const second = date.getSeconds()
  return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
}

const formatNumber = n => {
  n = n.toString()
  return n[1] ? n : '0' + n
}

module.exports = {
  formatTime: formatTime,
  formatNumber:formatNumber,
  categoryList:categoryList,
  nearList: nearList
}

